#ifndef INPUT_DEVICE_H
#define INPUT_DEVICE_H

class InputDevice;

#include "Constants.h"
#include "Prereqs.h"

/*
 * Base class to provide input for a player. Extended for user controlled
 * devices as well as playing from a replay file and over a network
 */
class InputDevice
{
public:
    InputDevice();
    virtual ~InputDevice() {}
    
    // inherit to control ball with a new input device
    virtual void updateBall(Ogre::Real time) = 0;
    
    // inherit to initialise input device when registering a ball
    virtual bool registerBall(Ball *b) = 0;
    
    // inherit to e.g. disconnect from a network when unregistering ball
    virtual void unregisterBall()  = 0;
    
    virtual void initialise() {}
    
    virtual void reset() {}
    
    void useCamera(CameraControl *c) { camera = c; }
    CameraControl *getCamera() { return camera; }
    void setInvert(bool i);
    void setSensitive(bool s);
    void setSpeed(bool s);

protected:
    Ball *ball;
    Ogre::Vector3 original_gravity;
    CameraControl *camera;
    int invert, speed, sensitivity;
} ;

#endif
